<!-- 固定资产 -->
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>固定资产</title>
  <meta name="keywords" content="">
  <meta name="description" content="">
  <meta name="keywords" content="">
  <meta name="description" content="">
  <link href="../css/bootstrap.min.css?v=3.3.6" rel="stylesheet">  
  <link href="../css/plugins/bootstrap-table/bootstrap-table.min.css" rel="stylesheet">
  <link rel="stylesheet" type="text/css" href="../js/plugins/bootstrap-datetimepicker/build/css/bootstrap-datetimepicker.min.css">
  <link href="../js/plugins/jquery-confirm/jquery-confirm.css" rel="stylesheet">
  <link href="../js/plugins/tree_grid/themes/default/easyui.css" rel="stylesheet">
  <link href="../css/animate.css" rel="stylesheet">
  <link href="../css/style.css?v=4.1.0" rel="stylesheet">
  <link rel="stylesheet" href="../css/labMgt/self.css">
  <link rel="stylesheet" href="../css/labMgt/modal.css">
  <!-- 第三方插件 -->
  <link rel="stylesheet" href="../js/plugins/pace/pace-theme-barber-shop.css">
  <!-- 全局js -->
  <script src="../js/jquery.min.js?v=2.1.4"></script>
  <script src="../js/bootstrap.min.js?v=3.3.6"></script>
  <script src="../js/plugins/moment/min/moment-with-locales.min.js"></script>
  <script src="../js/plugins/bootstrap-datetimepicker/build/js/bootstrap-datetimepicker.min.js"></script>
  <script src="../js/plugins/bootstrap-table/bootstrap-table.min.js"></script>
  <script src="../js/plugins/bootstrap-table/locale/bootstrap-table-zh-CN.min.js"></script>
  <script src="../js/plugins/jquery-confirm/jquery-confirm.js"></script>
  <script src="../js/plugins/tree_grid/jquery.easyui.min.js"></script>
  <script src="../js/main.js"></script>
  <script src="../js/plugins/pace/pace.min.js"></script>

</head>
<body class="gray-bg">
  <div class="wrapper wrapper-content animated fadeInRight worker-info">
    <div class="ibox query-info">
      <form class="base-info">
        <div class="pa-form-control">
          <label class="form-control-label">固定资产名称：</label>
          <input class="form-control form-control-input">
        </div>
        <div class="pa-form-control">
          <label class="form-control-label">资产分类:</label>
          <select class="form-control form-control-input">
            <option value="1">请选择</option>
          </select>
        </div>
        <div class="pa-form-control">
          <label class="form-control-label">使用部门/项目:</label>
          <select class="form-control form-control-input">
            <option value="1">请选择</option>
          </select>
        </div>
        <div class="pa-form-control">
          <label class="form-control-label">设备状态:</label>
          <select class="form-control form-control-input">
            <option value="1">请选择</option>
          </select>
        </div>
        <div class="row query-info-btn">
          <div class="col-sm-12 text-center">
            <button class="btn btn-sm btn-info" type="submit">查 询</button>
            <button class="btn btn-sm btn-white" type="reset">重 置</button>
          </div>
        </div>
      </form>
    </div>
    <div class="row row-btn-item">
      <div class="col-sm-12">
        <button class="btn btn-info" >二维码打印</button>
        <button class="btn btn-sm btn-info" onclick="deleteWorker()">删除</button>
        <button class="btn btn-sm btn-info">导出台账</button>
      </div>
    </div>
    <div class="row">
      <div class="col-sm-12">
        <div id="accordion1" class="ibox float-e-margins">
          <div id="table1" class="ibox-content collapse in" aria-expanded="true">            
            <table id="worker-table" class="footable table table-stripped text-center">
              <thead>
                  <tr>
                    <th data-field="id" data-formatter="getCheckBox"><input type="checkbox"
                      onchange="selectAll(this)"/></th>
                    <th data-field="field1">设备编号</th>
                    <th data-field="field2">设备名称</th>
                    <th data-field="field3">规格型号</th>
                    <th data-field="field4">使用部门/项目</th>
                    <th data-field="field5">设备状态</th>
                    <th data-field="field6" data-width="19%" data-formatter="clickOperate">操作</th>
                  </tr>
              </thead>
              <tbody>
              </tbody>
            </table>
          </div>
        </div>
      </div>
    </div>
  </div>

  <!-- 报废登记 -->
  <div class="modal fade" id="scrap_modal" role="dialog"
    aria-labelledby="scrap_modal_label">
    <div class="modal-dialog" role="document">
      <div class="modal-content">
        <div class="modal-header">
          <button type="button" class="close" data-dismiss="modal" aria-label="Close">
            <span aria-hidden="true">&times;</span>
          </button>
          <h5 class="modal-title" id="scrap_modal_label">报废登记</h5>
        </div>
        <div class="modal-body">
          <form id="scrap_modal_form" class="add-edit-form">
            <table class="form-table">
              <tbody>
                <tr>
                  <td class="title">申请部门：</td>
                  <td>
                    <select class="form-control form-control-input">
                      <option value="1">请选择</option>
                    </select>
                  </td>
                </tr>
                <tr>
                  <td class="title">申请日期：</td>
                  <td class="table-td-input-time">
                    <input id="startTime" name="startTime"
                    type="text" date-type="start"
                    class="form-control form-control-input datetimepicker"
                    data-date-format="YYYY-MM-DD">
                  </td>
                </tr>
                <tr>
                  <td class="title">资产原产值：</td>
                  <td><input name="" type="text" class="form-control form-control-input"></td>
                </tr>
                <tr>
                  <td class="title">累计折旧额：</td>
                  <td><input name="" type="text" class="form-control form-control-input"></td>
                </tr>
                <tr>
                  <td class="title">残值：</td>
                  <td><input name="" type="text" class="form-control form-control-input"></td>
                </tr>
                <tr>
                  <td class="title">净值：</td>
                  <td><input name="" type="text" class="form-control form-control-input"></td>
                </tr>
                <tr>
                  <td class="title">使用年限：</td>
                  <td><input name="" type="text" class="form-control form-control-input"></td>
                </tr>
                <tr>
                  <td class="title">已使用日期：</td>
                  <td class="table-td-input-time">
                    <input id="startTime" name="startTime"
                    type="text" date-type="start"
                    class="form-control form-control-input datetimepicker"
                    data-date-format="YYYY-MM-DD">
                  </td>
                </tr>
                <tr>
                  <td class="title">是否出售：</td>
                  <td>
                    <select class="form-control form-control-input">
                      <option value="1">是</option>
                      <option value="0">否</option>
                    </select>
                  </td>
                </tr>
                <tr>
                  <td class="title">出售收入：</td>
                  <td><input name="" type="text" class="form-control form-control-input"></td>
                </tr>  
                <tr>
                  <td class="title">出售支出：</td>
                  <td><input name="" type="text" class="form-control form-control-input"></td>
                </tr>                  
                <tr>
                  <td class="title">备注：</td>
                  <td><textarea class="form-control form-control-input" name="remarks" type="text"></textarea></td>
                </tr>
              </tbody>
            </table>
          </form>
        </div>
        <div class="modal-footer">
          <button class="btn btn-default" data-dismiss="modal">取 消</button>
          <button class="btn btn-primary" type="submit" onclick="addModule('addChildNode_form')">确 定</button>
        </div>
      </div>
    </div>
  </div>


  <script>
    $(document).ready(function() {
      var $table = $('#worker-table');
      $table.bootstrapTable({
        data: data,
        pagination: true,
        pageSize: 10
      });
    });

    var data = [
      {
        field1: 'SY20150603001',
        field2: '压力测试机',
        field3: 'LT0515',
        field4: 'G220公路工程',
        field5: '正常',
      },
    ];

    function getCheckBox(id, row) {
      var html = '<input type="checkbox" name="checkbox" sid="' + id + '">';
      return html;
    }

    //用户，全选/全不选
    function selectAll(ele) {
      var bool = $(ele).is(':checked');
      $('input[name="checkbox"]').prop("checked", bool);
    };

    function clickOperate(id, row) {
      var roleIds = row.roleIds;
      // 传值给click事件
      return "<a class='qn-check' href='equipmentDetail.html'>查看</a>" +
             "<a class='qn-check' onclick='scrap(`" + id + "`)'>报废</a>";
    }

    function scrap(){
      $('#scrap_modal').modal('show');
    }

    // 删除
    function deleteWorker() {
      var ids = $.map($('input[name="checkbox"]'), function (item) {
        if ($(item).is(':checked')) {
          return $(item).attr("sid");
        }
      });
      if(ids.length == 0){
        showAlert(null,"请选择数据后再删除");
        return;
      }
      showConfirm("提示","是否确定删除？",function() {
        
      });
    }
  </script>
</body>
</html>